package com.xqls.util;

import java.math.BigDecimal;

/**
 * Created by tx on 2017/6/29.
 */
public class Retaindecimal {

    public Double divideTen(Integer s){
        int a=10;
        Double b=s*1.0/a;
        BigDecimal decimal = new BigDecimal(b);
        BigDecimal result=decimal.setScale(1, BigDecimal.ROUND_HALF_UP);
        return result.doubleValue();
    }
    public Double divideHundred(Integer s){
        int a=100;
        Double b=s*1.0/a;
        BigDecimal decimal = new BigDecimal(b);
        BigDecimal result=decimal.setScale(2, BigDecimal.ROUND_HALF_UP);
        return result.doubleValue();
    }
}
